﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcPompling.Models;
using System.Data;
using System.Configuration;

namespace MvcPompling.Controllers
{
    public class HomeController : Controller
    {
        private WebPropertyDataEntities db = new WebPropertyDataEntities();

        // GET: /Home/

        public ActionResult Index()
        {
           // string conStrring = ConfigurationManager.ConnectionStrings["PomplingEntities"].ConnectionString;
            using (var entity = new WebPropertyDataEntities())
            {
                //db.Database.Connection.ConnectionString = @"Data Source=OWNER-PC\SQLEXPRESS;Initial Catalog=Pompling;Integrated Security=true";
                //var customer = new PomplingCustomer();
                //customer.Email = "testemail@here.co.uk";
                //customer.IsCompany = false;
                //customer.PomplingPassword = "mypassword";
                //customer.UserName = "myUsername";
                //db.Customers.Add(customer);
                //if (customer.PomplingCustomerID == 0)
                //{
                //    db.Entry(customer).State = EntityState.Added;
                //}
                //else
                //{
                //    db.Entry(customer).State = EntityState.Modified;
                //}
                //db.SaveChanges();
            }
            //PomplingCustomer customer = new PomplingCustomer();         

            

            return View();
        }

    }
}
